<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<title><?php echo C("SITE_NAME");?>管理后台</title>
<link rel="shortcut icon" href=" /favicon.ico" />
<link rel="stylesheet" href="/Static/admin/css/component-min.css">
<link rel="stylesheet" href="/Static/admin/css/home.2015.05.22-09.32.css">
<link rel="stylesheet" href="/Static/admin/icon/iconfont.css">
<!--弹窗-->
<script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
<script src="/Static/admin/js/layer-2.x/layer.js?v=1.9.0"></script>
<script src="/Static/admin/js/common.js"></script>
<script>
	var UPYUN_DOMAIN = '<?php echo C("UPYUN_DOMAIN");?>';
</script>
</head>
<body class="cp-bodybox">
<!--[if lt IE 9]>
<div class="alert alert-danger disable-del txtCenter" id="tipLowIEVer">
    <h4>系统检测到您使用的浏览器版本过低，为达到更好的体验效果请升级您的浏览器，我们为您推荐：</h4>
    <p>
        <a href="http://www.firefox.com.cn/download/" target="_blank">Firefox浏览器</a>
        <a href="http://www.maxthon.cn/" target="_blank">遨游浏览器</a>
        <a href="http://se.360.cn/" target="_blank">360浏览器</a>
    </p>
</div>
<![endif]-->
<style>
.header-nav-list a {
  display: block;
  padding: 0 10px;
  min-width: 70px;
  line-height: 53px;
  font-size: 14px;
  text-align: center;
  font-weight: 700;
}
</style>

<div class="header">
    <div class="inner clearfix">
        <div class="fl">
            <a href="/" class="header-logo">
                <img
                    src="<?php echo C('UPYUN_DOMAIN'); echo C('SITE_TOPLOGO2');?>"
                    onerror="javascript:this.src='/Static/admin/images/error.png';"
                    ></a>
        </div>
        <!-- end logo -->

        <div class="header-nav fl">
            <ul class="header-nav-list clearfix">
                <!--<li class="fl <?php echo ($controller == 'index')?'active':'';?>"><a href="/admin">首页</a></li>-->
                <?php foreach($MENU as $k=>$v){?>
                <li class="fl <?php echo ($controller == $v['controller'])?'active':'';?>">
                    <a href="<?php echo $v['url'];?>"><?php echo $v['title'];?></a>
                </li>
                <?php } ?>
            </ul>
        </div>
        <!-- end header-nav -->

        <div class="fr">
            <ul class="header-ctrl clearfix">
                <li class="header-ctrl-item fl"><a href="/admin/login/logout">退出</a></li>
            </ul>
        </div>

        <span class="account_inbox_switch fr"></span>
        <span class="header-welcome fr">
            <a href="javasecript:;" class="tips" data-trigger="hover" data-placement="top"><?php echo $admininfo['username'];?></a>
        </span>

    </div>
</div>
<!-- end header -->
	<div class="container">
		<div class="inner clearfix">
	<div class="content-left fl">
    <?php foreach($SUBMENU as $subkey=>$sub){ ?>
    <dl class="left-menu shop_8">
        <dt>
            <i class="icon-menu home"></i> <span id="shop_0" data-id="0"><?=$sub['title']?></span>
        </dt>
        <?php foreach($sub['menu'] as $menu){ ?>
        <dd class="<?php echo ($action == $menu["action"])?'active':'';?>">
            <a href="<?=$menu['url']?>"><?=$menu['title']?></a>
        </dd>
        <?php } ?>
    </dl>
    <?php } ?>
</div>
<div class="content-right fl">
    <h1 class="content-right-title">提现申请列表</h1>
    <div class="tablesWrap">
        <form action="" method="get" name="form1">
            <div class="tables-searchbox">
            	<input type="text" class="input" name="uid" id="uid" value="<?php echo get('uid');?>" placeholder="用户ID">
                <input type="text" class="input" name="mobile" id="mobile" value="<?php echo get('mobile');?>" placeholder="手机号">
                <input type="text" class="input" name="realname" id="realname" value="<?php echo get('realname');?>" placeholder="姓名">
                
			<select name="status" class="select mini" id="status">
				<option value="" <?php echo (get("status") == "") ? "selected" : "";?> >审核状态</option>
				<option value="0" <?php echo (get("status") == "0" && (get("status") !='')) ? "selected" : "";?> >未审核</option>
				<option value="1" <?php echo (get("status") == "1") ? "selected" : "";?> >已打款</option>
			</select>
                
                <button class="btn btn-primary"><i class="gicon-search white"></i>查询</button>
                <a href="/admin/finance/index" class="btn btn-warning">清除查询</a>
  
				<a class="btn btn-success " href="javascript:excel();"><i class="gicon-share white"></i>导出</a>
			
            </div>
        </form>
        <!-- end tables-searchbox -->
        <table class="wxtables">
         	<colgroup>
                <col width="4%">
                <col width="6%">
                <col width="7%">
                <col width="4%">
                <col width="6%">
                <col width="6%">
                <col width="7%">
                <col width="7%">
                <col width="6%">
                <col width="7%">
                <col width="6%">
                <col width="6%">
                <col width="6%">
                <col width="7%">
                <col width="8%">
            </colgroup>
            <thead>
            <tr>
                <td>用户ID</td>
                <td>真实姓名</td>
                <td>手机号</td>
                <td>账户类型</td>
                <td>银行名称</td>
                <td>开户行</td>
                <td>银行卡号</td>
                <td>提现金额</td>
                <td>个税基金</td>
                <td>实发金额</td>
                <td>申请时间</td>
                <td>审核时间</td>
                <td>审核人</td>
                <td>状态</td>
                <td>操作</td>
            </tr>
            </thead>
            <tbody>
            
            
<?php foreach($datalist as $k=>$v){ ?>
            <tr>
                <td><?php echo $v['uid'];?></td>
                <td><?php echo $v['realname'];?></td>
                <td><?php echo $v['mobile'];?></td>
                <td><?php echo $v['account_type']==1?'个人':'对公';?></td>
                <td><?php echo $v['bankname'];?></td>
                <td><?php echo $v['kaihuhang'];?></td>
                <td><?php echo $v['bankcard'];?></td>
                <td><?php echo $v['atm_money'];?></td>
                <td>-<?php echo $v['shouxufei'];?></td>
                <td><span style="color:#ff0000;"><?php echo $v['withdraw_money'];?></span></td>
                
                <td><?php echo $v['create_time'];?></td>
                <td><?php echo $v['shenhe_time'];?></td>
                <td><?php echo $v['admin_username'];?></td>
                <td>
                <?php if($v['status']==0){?>
                <span style="color:red;">未审核</span>
                <?php }else if($v['status']==1){ ?>
                <span style="color:green;">已打款</span>
                <?php }else if($v['status']==2){ ?>
                <span style="color:red;">已拒绝</span>
                <?php } ?>
                </td>
                
                <td>
                <?php if($v['status']==0 && $v['bankname']!='微信钱包'){?>
                	<a href="javascript:shenhe('<?php echo $v['atm_id'];?>');" class="btn btn-success btn-small">审核</a>
                <?php }else if($v['status']==0 && $v['bankname']=='微信钱包'){ ?>
                	<a href="javascript:dakuan('<?php echo $v['atm_id'];?>');" class="btn btn-success btn-small">打款</a>
                <?php } ?>
                </td>
</tr>
<tr style="background-color: #eee;">
    <td colspan="15" style="text-align:left;">备注: <input id="note<?=$v['atm_id']?>" value="<?=$v['note']?>" type="text" class="input mini xxlarge" placeholder="添加备注">
        <button onclick="setNote(<?=$v['atm_id']?>)"  class="btn btn-primary vtal-2">确认</button>
    </td>
</tr>

<?php } ?>                         
                         
                         
                         
                            </tbody>
        </table>
	<div class="tables-btmctrl clearfix">
           <div class="mgt10">
               <div class="paginate">
                  <?php echo ($page); ?>
               </div>
           </div>
	</div>
    </div>

</div>

<script>
function setNote(atm_id) {
    var note =  $('#note'+atm_id).val();
    var data = {
        atm_id: atm_id,
        note: note
    };
    layer.load();
    $.post('/admin/finance/setnote',data,function (res) {
        layer.msg(res.msg, {icon: res.ret+1});
    })
}
function excel(){

	var mobile = $("#mobile").val();
	var realname = $("#realname").val();
	var status = $("#status").val();

	var url = "/admin/finance/indexexcel/?mobile="
			+mobile+"&realname="+realname
			+"&status="+status;
	
	layer.msg('正在导出,请耐心等待...', {icon: 16});
	
	window.location.href = url;
	
}

function dakuan(id){
	var url = "/admin/finance/dakuan/?atm_id="+id;
	var title = "微信钱包的提现确认打款后立即到帐且无法撤回，确定打款吗？";
	
	layer.confirm(title, {
	    btn: ['确定通过','我再想想'] //按钮
	}, function(){
		AjaxUrl(url);
	}, function(){
		layer.msg('你取消了审核', {icon: 7});
	});
}

function shenhe(id){
	var url = "/admin/finance/shenhe/?atm_id="+id;
	var title = "(审核流程:1.财务网银转账 2.点击审核按钮,确认打款)确定审核通过吗?";
	
	layer.confirm(title, {
	    btn: ['确定通过','我再想想'] //按钮
	}, function(){
		AjaxUrl(url);
	}, function(){
		layer.msg('你取消了审核', {icon: 7});
	});
	
	
}

</script>
		</div>
	</div>
<!--gonggao-->
<div class="footer">&copy; <?php echo date("Y");?> <?php echo C("SITE_NAME");?> , Inc. All rights reserved.</div>
<a href="#" id="j-gotop" class="gotop" title="回到顶部" style="right:45px; display: inline;"></a>
<script type="text/javascript">
$(function(){
    var height1=$(".content-right").height();
    var height2=$(".content-left").height();
    if(parseInt(height1) < parseInt(height2)){
        $(".content-right").css({'min-height': height2});
    }
    $(window).scroll(function() {
		$(this).scrollTop() >= 150 ? $("#j-gotop").fadeIn(300) : $("#j-gotop").fadeOut(300)
	});
});
</script>
</body>
</html>